<template>
  <div class="auth-layout">
    <!-- 背景装饰 -->
    <div class="background-decoration">
      <div class="decoration-circle circle-1"></div>
      <div class="decoration-circle circle-2"></div>
      <div class="decoration-circle circle-3"></div>
      <div class="decoration-circle circle-4"></div>
      <div class="decoration-gradient gradient-1"></div>
      <div class="decoration-gradient gradient-2"></div>
    </div>

    <!-- 主要内容区域 -->
    <div class="auth-container">
      <!-- 左侧品牌区域 -->
      <div class="brand-section">
        <div class="brand-visual">
          <!-- 3D 几何装饰 -->
          <div class="geometric-shapes">
            <div class="shape shape-1"></div>
            <div class="shape shape-2"></div>
            <div class="shape shape-3"></div>
            <div class="shape shape-4"></div>
          </div>

          <!-- 主要内容 -->
          <div class="brand-content">
            <div class="brand-logo-container">
              <img alt="零码智绘 Logo" class="brand-logo" src="@/assets/logo.png" />
            </div>
            <h1 class="brand-title">零码智绘</h1>
            <p class="brand-tagline">AI 驱动的代码生成平台</p>
          </div>

          <!-- 浮动元素 -->
          <div class="floating-elements">
            <div class="floating-dot dot-1"></div>
            <div class="floating-dot dot-2"></div>
            <div class="floating-dot dot-3"></div>
            <div class="floating-line line-1"></div>
            <div class="floating-line line-2"></div>
          </div>
        </div>
      </div>

      <!-- 右侧表单区域 -->
      <div class="form-section">
        <div class="form-container">
          <router-view />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// Auth layout for login and register pages
</script>

<style scoped>
.auth-layout {
  min-height: 100vh;
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.background-decoration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.decoration-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.circle-1 {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.circle-3 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

.circle-4 {
  width: 80px;
  height: 80px;
  top: 30%;
  right: 30%;
  animation-delay: 1s;
}

.decoration-gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: float 8s ease-in-out infinite;
}

.gradient-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  top: 20%;
  left: 5%;
  animation-delay: 0s;
}

.gradient-2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  bottom: 15%;
  right: 10%;
  animation-delay: 3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.auth-container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 60px 40px;
}

.brand-visual {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geometric-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.shape-1 {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  top: 15%;
  left: 15%;
  transform: rotate(15deg);
  animation: float 6s ease-in-out infinite;
}

.shape-2 {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  top: 60%;
  right: 20%;
  animation: float 8s ease-in-out infinite reverse;
}

.shape-3 {
  width: 60px;
  height: 100px;
  border-radius: 30px;
  bottom: 25%;
  left: 25%;
  transform: rotate(-20deg);
  animation: float 7s ease-in-out infinite;
}

.shape-4 {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  top: 35%;
  right: 35%;
  transform: rotate(45deg);
  animation: float 5s ease-in-out infinite;
}

.brand-content {
  text-align: center;
  color: white;
  position: relative;
  z-index: 10;
}

.brand-logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 32px;
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.brand-logo-container::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: all 0.3s ease;
}

.brand-logo-container:hover::after {
  opacity: 1;
}

.brand-title {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.brand-tagline {
  font-size: 16px;
  margin: 0;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.floating-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}

.dot-1 {
  top: 20%;
  left: 60%;
  animation-delay: 0s;
}

.dot-2 {
  top: 70%;
  left: 10%;
  animation-delay: 1s;
}

.dot-3 {
  top: 45%;
  right: 10%;
  animation-delay: 2s;
}

.floating-line {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  height: 1px;
}

.line-1 {
  width: 100px;
  top: 30%;
  left: 10%;
  transform: rotate(25deg);
  animation: fadeInOut 4s ease-in-out infinite;
}

.line-2 {
  width: 80px;
  bottom: 30%;
  right: 15%;
  transform: rotate(-30deg);
  animation: fadeInOut 4s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.form-section {
  flex: 0 0 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.form-container {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 56px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .auth-container {
    flex-direction: column;
    padding: 24px;
  }

  .brand-section {
    flex: none;
    padding: 40px 20px;
  }

  .brand-title {
    font-size: 32px;
  }

  .brand-tagline {
    font-size: 14px;
  }

  .shape-1 {
    width: 100px;
    height: 100px;
  }

  .shape-2 {
    width: 60px;
    height: 60px;
  }

  .shape-3 {
    width: 50px;
    height: 80px;
  }

  .form-section {
    flex: none;
    width: 100%;
    max-width: 520px;
  }

  .form-container {
    padding: 40px;
  }
}

@media (max-width: 768px) {
  .brand-section {
    padding: 20px;
  }

  .brand-logo {
    width: 80px;
    height: 80px;
  }

  .brand-section {
    padding: 30px 15px;
  }

  .brand-title {
    font-size: 28px;
  }

  .brand-tagline {
    font-size: 13px;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
  }

  .brand-logo-container {
    margin-bottom: 24px;
  }

  .shape-1 {
    width: 80px;
    height: 80px;
  }

  .shape-2 {
    width: 50px;
    height: 50px;
  }

  .shape-3 {
    width: 40px;
    height: 60px;
  }

  .shape-4 {
    width: 30px;
    height: 30px;
  }

  .form-container {
    padding: 32px;
    margin: 0 16px;
  }
}
</style>
